<?php if ($this->search_result) { ?>
<?php foreach ($this->search_result AS $key => $val) { ?>
<div class="aw-item<?php if ($val['type'] == 'questions' OR $val['type'] == 'articles') { ?> active<?php } ?>">
	<?php if ($val['type'] == 'topics') { ?>
	<a href="<?php echo $val['url']; ?>" class="aw-topic-img" data-id="<?php echo $val['search_id']; ?>"><img src="<?php echo $val['detail']['topic_pic']; ?>" alt="" /></a>
	<?php } else if ($val['type'] == 'users') { ?>
	<a href="<?php echo $val['url']; ?>" class="aw-user-img" data-id="<?php echo $val['search_id']; ?>"><img src="<?php echo $val['detail']['avatar_file']; ?>" alt="" /></a>
	<?php } ?>
	<?php if ($this->user_id) { ?>
		<?php if ($this->user['search_id'] != $this->user_id AND $val['type'] == 'users') { ?>
		<a href="javascript:;" onclick="AWS.User.follow($(this), 'user', <?php echo $val['search_id']; ?>);" class="btn btn-normal btn-success follow<?php if ($val['focus']) { ?> active<?php } ?>"><span><?php if ($val['focus']) { ?><?php _e('取消关注'); ?><?php } else { ?><?php _e('关注'); ?><?php } ?></span> <em>|</em> <b><?php echo $val['detail']['fans_count']; ?></b></a>
		<?php } ?>
	<?php } ?>
	<p class="aw-title">
		<?php if ($val['detail']['best_answer'] > 0 AND $val['type'] == 'questions') { ?><i class="icon icon-bestbg"></i><?php } ?>
		<?php if ($val['type'] == 'topics') { ?>
		<span class="topic-tag">
			<a href="<?php echo $val['url']; ?>" class="text" target="_blank"><?php echo $val['name']; ?></a>
		</span>
		<?php } else { ?>
		<a href="<?php echo $val['url']; ?>" target="_blank"><?php echo $val['name']; ?></a>
		<?php } ?>
	</p>

	<?php if ($val['type'] == 'users' AND $val['detail']['signature']) { ?>
	<p class="text-color-999"><?php echo $val['detail']['signature']; ?></p>
	<?php } ?>

	<p class="aw-text-color-666">
		<?php if ($val['type'] == 'questions') { ?>
		<i class="icon icon-reply"></i> <?php _e('%s 个回复', $val['detail']['answer_count']); ?> • <?php _e('%s 人关注', $val['detail']['focus_count']); ?>
		<?php } else if ($val['type'] == 'articles') { ?>
		<i class="icon icon-comment"></i> <?php _e('%s 个回复', $val['detail']['comments']); ?> • <?php _e('%s 次查看', $val['detail']['views']); ?>
		<?php } else if ($val['type'] == 'topics') { ?>
		<i class="icon icon-topic"></i> <?php _e('%s 个讨论', $val['detail']['discuss_count']); ?>
		<?php } else if ($val['type'] == 'users') { ?>
		<span>
			<i class="icon icon-prestige"></i><?php _e('威望'); ?><?php echo $val['detail']['reputation']; ?>
		</span>
		<span>
			<i class="icon icon-agree"></i> <?php _e('赞同'); ?> <?php echo $val['detail']['agree_count']; ?>
		</span>
		<span>
			<i class="icon icon-thank"></i><?php _e('感谢'); ?> <?php echo $val['detail']['thanks_count']; ?>
		</span>
		<?php } ?>
	</p>
</div>
<?php } ?>
<?php } ?>